package com.hzw.saas.api.hpc.enums;

import java.util.Objects;

/**
 * <p>
 *
 * </p>
 *
 * @author sonam
 * @since 2021/3/25 15:20
 */
public enum  HpcAccountPoolStatus {
    FREE(1, "空闲"),
    BE_OCCUPIED(2, "被占用"),
    ;

    private final Integer value;
    private final String text;

    HpcAccountPoolStatus(Integer value, String text) {
        this.value = value;
        this.text = text;
    }

    public Integer value() {
        return value;
    }

    public String text() {
        return text;
    }

    public static String text(Integer value) {
        for (HpcAccountPoolStatus hpcAccountStatus : HpcAccountPoolStatus.values()) {
            if (Objects.equals(hpcAccountStatus.value, value)) {
                return hpcAccountStatus.text;
            }
        }
        return null;
    }

    public static HpcAccountPoolStatus instance(Integer value) {
        for (HpcAccountPoolStatus hpcAccountStatus : HpcAccountPoolStatus.values()) {
            if (Objects.equals(hpcAccountStatus.value, value)) {
                return hpcAccountStatus;
            }
        }
        return null;
    }
}
